<template>
	<view class="padb20">
		<cu-custom bgColor="bg-gradual-blue" isBack="true">
			<block slot="content">异常记录</block>
		</cu-custom>
		<scroll-view scroll-x class="bg-white nav">
			<view class="cu-item ripple" :class="TabCur==0?'text-orange cur':''" @tap="tab(0)" :data-id="0">
				我发布的
			</view>
			<view class="cu-item ripple" :class="TabCur==1?'text-orange cur':''" @tap="tab(1)" :data-id="1">
				与我相关
			</view>
		</scroll-view>
		<view class="pad3">
			<view class="bcf round3 pad2" v-for="item in list" v-if="$com.isbool(list)">
				<view class="flrc bdbda lh2">
					<view class="">订单</view>
					<view class="flex1 tar">{{item.orderPoint.streamOrder.sn}}</view>
				</view>
				<view class="flrc bdbda lh2">
					<view class="">发现工序</view>
					<view class="flex1 tar">{{item.orderPoint.point.name}}</view>
				</view>
				<view class="flrc bdbda lh2">
					<view class="">问题工序</view>
					<view class="flex1 tar">{{item.targetPoint.name}}</view>
				</view>
				<view class="flrc bdbda lh2">
					<view class="">上报时间</view>
					<view class="flex1 tar">{{$com.str2time(item.createAt)}}</view>
				</view>
				<view class="flrc bdbda lh2">
					<view class="">上报人</view>
					<view class="flex1 tar">{{item.createBy.name}}</view>
				</view>
				<view class="list-style-1 martb3">上报问题</view>
				<view class="pad2">{{item.info}}</view>
				<view class="mart3">
					<image class="w100" mode="widthFix" :src="$api.aroot() + pic" v-for="pic in item.pics"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from '../../../static/js/api.js'
	import com from '../../../static/js/com.js'
	import win from '../../../static/js/win.js'
	import list from '../../../static/js/list.js'
	export default {
		data() {
			return {
				item: false,
				info: false,
				TabCur: 0,
				list: []
			}
		},
		methods: {
			tab(index) {
				this.TabCur = index
				list.setData({
					type: this.TabCur
				})
				list.reload()
			}
		},
		onLoad(option) {
			list.setUrl('/api/my/streamOrderRecords')
			list.setData({
				type: this.TabCur
			})
			list.setCbFunc((res) => {
				this.list = res
			})
			list.reload()
		}
	}
</script>

<style>

</style>
